Skip to content

Dev#3

Merged
vchan-in merged 7 commits intomainfrom
dev
Feb 28, 2026
Merged

Dev#3
vchan-in merged 7 commits intomainfrom
dev

Conversation

@vchan-in
Copy link
Collaborator

Description

Three improvements landing in 1.1.0, plus a housekeeping fix:

  1. Two-tier write locking — memory file writes are now protected by a stacked cross-process advisory lockfile (crossProcessLock.ts) on top of the existing per-file in-process promise queue. Prevents corruption when multiple VS Code windows or extension host restarts hit the same .memory/ files concurrently.

  2. Plan agent patching — on every activation the extension injects queryMemory + storeMemory into the Copilot Chat built-in Plan agent, and inserts a memory-context instructions block. Ensures the planning agent is automatically memory-aware without any user setup.

  3. Higher default category limits — defaults doubled (Instruction/Security 15→30, others 20→40) and the configurable ceiling raised from 50 to 100. Active projects were hitting limits too quickly.

  4. Untrack .memory/cleanup.log — the file was already in .gitignore but had been previously committed; removed from the index so it no longer appears in diffs.

Changes

File Change
extension/src/storage/crossProcessLock.ts New — advisory lockfile with atomic fs.open('wx'), linear back-off, stale-lock cleanup
extension/src/storage/crossProcessLock.test.ts New — tests for lock acquisition, contention, and stale-lock recovery
extension/src/storage/markdownStore.ts All writes now go through withMemoryWriteLock() (stacks cross-process + per-file locks); clearStaleLockOnStartup() called from ensureMemoryDir()
extension/src/instructionFiles.ts Add patchPlanAgent() — injects memory tools and instructions block into Plan agent file (idempotent, silent no-op if absent)
extension/src/extension.ts Call patchPlanAgent() on activate and on reinit command
extension/src/utils.ts Raise default fallback limit 20→40
extension/src/memoryPanel.ts Raise UI validation cap 50→100; update displayed default 20→40
extension/package.json Raise default and maximum for all five categoryLimit.* settings; version 1.0.01.1.0
CHANGELOG.md Add [1.1.0] entry
docs/architecture.md Document two-tier locking design
docs/decisions.md Add ADR 0018 (two-tier write locking)
docs/api-reference.md Update Memory Categories table with new defaults
docs/user-guide.md Update settings table with new defaults
extension/README.md Update settings table
README.md Update category limits row
.memory/decisions.md Store category-limits and lock architecture decisions
.memory/cleanup.log Removed from index (untracked; covered by .gitignore)

Testing

  • npm run build passes
  • npm test passes (all tests green)
  • Manually tested in Extension Development Host

crossProcessLock.test.ts covers: successful lock acquisition, concurrent contention (second caller waits), stale lock removal by age, stale lock removal by dead PID, and clearStaleLockOnStartup. patchPlanAgent verified manually — Plan agent file is updated on activation and idempotent on re-runs. Category limit changes verified via Settings UI — new defaults appear and values up to 100 are accepted.

Documentation

  • Updated docs/ for architecture / API changes
  • Added or updated an ADR in docs/decisions.md for architectural decisions

Memory

  • Stored new decisions / patterns to .memory/decisions.md (or relevant category)

Stored: two-tier write lock architecture, plan agent patching approach, updated category limit defaults.

Checklist

  • No new bare globalState string keys (used the constants file)
  • No direct vscode.lm calls outside lm.ts
  • markdownDescription used for any new settings (not description)
  • Conventional commit message (feat:, fix:, docs:, test:, etc.)

- Remove Antigravity and Gitpod as stated supported editors
- Add Open VSX compatibility table to README showing what works at each level
- Add ADR 0017: additional editor support via MCP (planned)
- Update ADR 0016 to reflect VS Code only (not 'any Open VSX editor')
- Fix broken ADR 0017 anchor in roadmap
- Update ADR count in README to 17
- Reword Open VSX callout in getting-started to be unambiguous
Relative path icon.png breaks on VS Marketplace and Open VSX
which render the README as a remote webpage.
- Add crossProcessLock.ts: advisory lockfile (.memory/.lock) using fs.open('wx')
  for atomic cross-process mutual exclusion; linear back-off, stale-lock cleanup
  on startup (clearStaleLockOnStartup) and on dead PID/age > 10 s
- Stack cross-process lock over existing per-file promise queue via
  withMemoryWriteLock() — single entry point used by appendMemory, upsertMemory,
  deleteMemory, migrateFiles; no callers interact with either lock directly
- Add crossProcessLock.test.ts covering lock acquisition, contention, and
  stale-lock recovery
- Add patchPlanAgent() in instructionFiles.ts: injects queryMemory + storeMemory
  into the Copilot Chat Plan agent tools list and inserts a memory-context section
  in the agent body on every activation (idempotent, silent no-op if absent)
- Call patchPlanAgent() on activate() and on reinit command
- Double default category limits: Instruction/Security 15→30,
  Quirk/Preference/Decision 20→40; raise schema maximum 50→100; update fallback
  in utils.ts and UI validation cap in memoryPanel.ts to match
- Update docs/architecture.md, docs/decisions.md, docs/api-reference.md,
  docs/user-guide.md, both READMEs, and .memory files to reflect all changes
@vchan-in vchan-in merged commit 2c734e0 into main Feb 28, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant